Skip to content

Correct accessibily for package-private fields #1685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

EgorkaKulikov
Copy link
Collaborator

@EgorkaKulikov EgorkaKulikov commented Jan 17, 2023

Description

Consider the following scenario:

  • we need to access package-private field
  • it is declared in a class that is in the same package as a test class
  • but the resolved variable type is represented in a class from another package

Thus we get compilation error. Here is a fix for it.

Fixes # (1677)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Automated Testing

Run ContestEstimator with the following filter:

methodFilter = "spoon.support.reflect.code.CtAssignmentImpl.*"

Manual Scenario

Standard regression checks on package-private fields accessors.

Checklist (remove irrelevant options):

This is the author self-check list

  • [+] The change followed the style guidelines of the UTBot project
  • [+] Self-review of the code is passed
  • [+] No new warnings

@EgorkaKulikov EgorkaKulikov force-pushed the egor/access_packageprivate_variables branch from 620d4ae to 38f40c0 Compare January 17, 2023 13:17
@EgorkaKulikov EgorkaKulikov merged commit 1438c55 into main Jan 17, 2023
@EgorkaKulikov EgorkaKulikov deleted the egor/access_packageprivate_variables branch January 17, 2023 14:11
@alisevych alisevych added comp-codegen Issue is related to code generator comp-contest-estimator Issue is related to contest estimator ctg-bug-fix PR is fixing a bug labels Jan 19, 2023
@alisevych alisevych added this to the 2023.03 Release milestone Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator comp-contest-estimator Issue is related to contest estimator ctg-bug-fix PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Failed to compile test class CtAssignmentImplTest' on spoon-core-7.0.0
3 participants